package com.hzdesk.media.koreabatchmatvector.dao;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;


import com.github.yuweiguocn.library.greendao.MigrationHelper;
import com.hzdesk.media.koreabatchmatvector.bean.DaoMaster;
import com.hzdesk.media.koreabatchmatvector.bean.DaoSession;
import com.hzdesk.media.koreabatchmatvector.bean.VideoFileDao;


/**
 * Created by Administrator on 2018/5/29.
 */

public class Helper extends DaoMaster.OpenHelper {
    private static DaoMaster daoMaster;
    private static DaoSession daoSession;
    public static final String DBNAME = "DeskmediaClickPostil.db";
    public Helper(Context context, String name, SQLiteDatabase.CursorFactory factory) {
        super(context, name,factory);
    }

    /**
     * 数据库升级
     * @param db
     * @param oldVersion
     * @param newVersion
     */
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        //操作数据库的更新 有几个表升级都可以传入到下面
        MigrationHelper.migrate(db, VideoFileDao.class);
    }
}
